package cn.edu.fzu.homemaking.sso.service;

import cn.edu.fzu.homemaking.common.PageVO;
import cn.edu.fzu.homemaking.sso.domain.entity.Role;
import cn.edu.fzu.homemaking.sso.domain.entity.User;
import cn.edu.fzu.homemaking.sso.domain.enums.StatusEnum;

import java.util.List;

public interface RoleService {

    PageVO<Role> list(String name, StatusEnum status, Integer pageNum, Integer pageSize);


    void add(String name, String description, User currentUser);


    void update(Long id, String description, StatusEnum status, User currentUser);


    void delete(Long id, User currentUser);


    /** 授权 **/
    void grant(Long userId, List<Long> roleIds, User currentUser);


    /** 查询当前用户所有的角色id **/
    List<Long> listRoleIdByUserId(Long userId);


    List<Long> listUserIdByRoleId(Long roleId);


    /** 查询当前用户拥有的角色列表 **/
    List<Role> listCurrentUserRole(User currentUser);
}
